function normal(data:Object):Object
{
	// Packages.log(this._name+".normal");

	var content:String="";
	content+="<portlet name='commentListContentContainer' x='5' y='0' layout='list:70:640' >"
	for (var a=0;a<data.objects.length;a++)
	{
		content+=getCommentItem(data.objects[a]);
	}

	content+="</portlet>";

	content+=appendOper(75, "CommentListOperLabel_Normal");

	var voData:Object=new Object();
	voData.type="Template";
	voData.content=addCommonPart(content);

	return voData;
}

function expand(data:Object):Object
{
	var content:String="";
	content+="<portlet name='commentListContentContainer2' x='5' y='0' layout='list:400:640' >"
	for (var a=0;a<data.objects.length;a++)
	{
		content+=getCommentItem(data.objects[a]);
	}

	content+="</portlet>";

	content+=appendOper(405, "CommentListOperLabel_Expand");
	content+=addPageSection();

	var voData:Object=new Object();
	voData.type="Template";
	voData.content=addCommonPart(content);

	return voData;
}

function getCommentItem(item:Object):String
{
	var lineHeight=Packages.system.utils.TextUtil.calcContentLines(item.body, "htmlText", 450, 20)*20;
	var cont:String="";
	cont+="<portlet name="+"'commentItem_"+item.bookCommentId+"' drag='no' height='24'>";	
	cont+="<portlet name='commentMemberImage' linew='-1' curve='10' height='24' width='24' x='5' />";
	cont+="<textfield name='commentMember_"+item.bookCommentId+"' x='40' html='true' selectable='no' width='35' height='20'>"+item["member.nickName"]+":</textfield>";
	cont+="<textfield name='commentBody_"+item.bookCommentId+"' x='75' html='true' selectable='no' width='450' multiline='true' height='"+lineHeight+"'>"+item.body+"</textfield>";
	cont+="<textfield name='commentTime_"+item.bookCommentId+"' x='555' html='true' selectable='no' width='100' height='20'>"+item.createTime+"</textfield>";
	cont+="</portlet>";

	return cont;
}

function addCommonPart(spec:String):String
{
	var content:String="";
	content+="<moonlight name='BookSpecial' template='BookSpecial-commentListContainer' uri='app/content/bookPage/BookSpecial.xml'>";
	content+="<portlet name='commentListInfo' drag='no' linew='-1' curve='0' height='90' width='650'>";

	content+=spec;

	content+="<handler ins='BookSpecial-commentListInfo' type='onMLInit' value='BookSpecial' src='lib:notes.components.content.bookPage.BookSpecial.onCommentListInit'/>";
	content+="</portlet></moonlight>";
	
	return content;
}

function appendOper(y:Number, operLabel:String):String
{
	var content="";
	content+="<textfield name='commentListOperLabel' x='520' y='"+y+"' width='150' selectable='no' html='true'>"+operLabel+"</textfield>";
	content+="<hotspot name='commentPostSpot' x='520' y='"+y+"' alpha='0' width='60' height='20'/>";
	content+="<hotspot name='commentMoreSpot' x='585' y='"+y+"' alpha='0' width='60' height='20'/>";

	return content;
}

function addPageSection():String
{
	var cont:String="";
	cont+="<textfield name='commentListPreLabel' x='20' y='405' width='50' selectable='no' html='true'>CommentListPreLabel</textfield>";
	cont+="<hotspot name='commentListPreSpot' x='20' y='405' alpha='0' width='50' height='20'/>";
	cont+="<textfield name='commentListCurrentPage' type='input' x='65' y='405' width='25'>1</textfield>";
	cont+="<textfield name='commentListSlash' x='95' y='405' width='10' selectable='no' html='true'>/</textfield>";
	cont+="<textfield name='commentListTotalPage' x='105' y='405' width='25' selectable='no' html='true'>10</textfield>";
	cont+="<textfield name='commentListNextLabel' x='130' y='405' width='50' selectable='no' html='true'>CommentListNextLabel</textfield>";
	cont+="<hotspot name='commentListNextSpot' x='130' y='405' alpha='0' width='50' height='20'/>";
	cont+="<handler ins='BookSpecial-commentListCurrentPage' type='onKeyUp' value='13' src='lib:notes.components.content.bookPage.BookSpecial.loadCommentList'><arg name='BookSpecial-commentListCurrentPage-text' as='pageNum'/></handler>";
	
	return cont;
}